package cn.yuanqiao.archive.wenjianzhengli.service.impl;

import cn.yuanqiao.archive.wenjianzhengli.domain.ConversionRules;
import cn.yuanqiao.archive.wenjianzhengli.mapper.ConversionRulesMapper;
import cn.yuanqiao.archive.wenjianzhengli.service.IConversionRulesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 转换规则Service业务层处理
 * 
 * @author xy
 * @date 2024-01-17
 */
@Service
public class ConversionRulesServiceImpl implements IConversionRulesService
{
    @Autowired
    private ConversionRulesMapper conversionRulesMapper;

    /**
     * 查询转换规则
     * 
     * @param id 转换规则主键
     * @return 转换规则
     */
    @Override
    public ConversionRules selectConversionRulesById(String id)
    {
        return conversionRulesMapper.selectConversionRulesById(new ConversionRules().getTableName(),id);
    }

    /**
     * 查询转换规则列表
     * 
     * @param conversionRules 转换规则
     * @return 转换规则
     */
    @Override
    public List<ConversionRules> selectConversionRulesList(ConversionRules conversionRules)
    {
        return conversionRulesMapper.selectConversionRulesList(conversionRules);
    }

    /**
     * 新增转换规则
     * 
     * @param conversionRules 转换规则
     * @return 结果
     */
    @Override
    public int insertConversionRules(ConversionRules conversionRules)
    {
        return conversionRulesMapper.insertConversionRules(conversionRules);
    }

    /**
     * 修改转换规则
     * 
     * @param conversionRules 转换规则
     * @return 结果
     */
    @Override
    public int updateConversionRules(ConversionRules conversionRules)
    {
        return conversionRulesMapper.updateConversionRules(conversionRules);
    }

    /**
     * 批量删除转换规则
     * 
     * @param ids 需要删除的转换规则主键
     * @return 结果
     */
    @Override
    public int deleteConversionRulesByIds(Long[] ids)
    {
        return conversionRulesMapper.deleteConversionRulesByIds(new ConversionRules().getTableName(),ids);
    }

    /**
     * 删除转换规则信息
     * 
     * @param id 转换规则主键
     * @return 结果
     */
    @Override
    public int deleteConversionRulesById(String id)
    {
        return conversionRulesMapper.deleteConversionRulesById(id);
    }
}
